/*
 * @Descripttion: 
 * @version: 
 * @Author: mmzhang
 * @Date: 2021-07-23 09:45:29
 * @LastEditTime: 2022-01-21 11:31:19
 */

import table from '@/components/dt/table/render.js'
import nameOpt from '@/biz/option/name.js'
import dateOpt from '@/biz/option/date.js'
import Opt from '@/components/dt/info/Opt.js'
import dt from '@dt/dt'

let _this = null

class Column extends Opt {
  constructor(vm) {
    super()
    _this = vm
    this.build()
  }

  build() {
    this.createAll()
    this.opts.push(...this.all)
  }

  createAll() {
    this.all = [
      {
        title: '官方渠道',
        field: 'buildingChannelName',
        minWidth: 200,
        align: 'center',
      },
      // {
      //   title: '渠道分类',
      //   field: 'channelType',
      //   minWidth: 120,
      //   align: 'center',
      // },
      {
        title: '已合案场渠道数',
        field: 'mergedChannelNum',
        minWidth: 120,
        align: 'center',
      },
      {
        title: '操作时间',
        field: 'operateTime',
        width: 200,
        align: 'center',
      },
      {
        title: '操作人',
        field: 'operator',
        width: 200,
        align: 'center',
      },
      {
        title: '操作',
        field: 'operation',
        width: 100,
        align: 'center',
        fixed: 'right',
        slots: {
          default: (params, h) => {
            let btns = []
            btns.push({
              // title: _this.unlocking('0102010403') ? '管理' : '',
              title: '管理',
              event: 'cancelRelation',
              data: params.row
            })
            return table.cell.btns(_this, h, btns)
          }
        }
      }
    ]
  }

}

export default Column